package com.itheima.d5_recursion;

import java.io.File;

/*
    目标：掌握文件删除
 */
public class RecursionTest3 {
    public static void main(String[] args) {
        File file = new File("E:\\aaa");
        delete(file);
    }

    public static void delete(File d){
        File[] files = d.listFiles();
        for (File file : files) {
            if(file.isFile()){
                file.delete();
            }else {
                delete(file);
            }
        }
        d.delete();
    }
}









